<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	 <meta charset="UTF-8" />
                <meta name="viewport" content="width=device-width, initial-scale=1.0">

                <title>Knowledge Base Theme</title>

                <link rel="shortcut icon" href="images/favicon.png" />


                

                <!-- Style Sheet-->
                <link rel="stylesheet" href="style.css"/>
                <link rel='stylesheet' id='bootstrap-css-css'  href='css/bootstrap5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='responsive-css-css'  href='css/responsive5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='pretty-photo-css-css'  href='js/prettyphoto/prettyPhotoaeb9.css?ver=3.1.4' type='text/css' media='all' />
                <link rel='stylesheet' id='main-css-css'  href='css/main5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='blue-skin-css'  href='css/blue-skin5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='custom-css-css'  href='css/custom5152.html?ver=1.0' type='text/css' media='all' />
				<link rel="stylesheet" href="css/no-show.css" type="text/css" />




<title>留言列表 -- HoverTree</title>
<style>
.keleyitable {
width: 800px;
}

.keleyitable table, td, th {
margin-top:10px;
}
.klytd {width:100px;text-align:right
}
.hvttd {
width:500px}
</style>
  <meta charset="UTF-8" />
</head>
<body>
<div class="header-wrapper">

	<div class="container">


		<div >
			<!-- Website Logo -->
			<a href="main.html"   >
				<img src="images/taru.jpg"
					 style="height:60px;">
			</a>
			<span class="tag-line">塔里木大学</span>
		</div>


		<!-- Start of Main Navigation -->
		<nav class="main-nav">
			<div class="menu-top-menu-container">
				<ul id="menu-top-menu" class="clearfix">
					<li class="current-menu-item"><a href="main.html">Home</a></li>
					<li><a href="#">科普模块</a>
						<ul class="sub-menu">
							<li><a @click="pes"  href="disease-list.html">虫害科普</a></li>
							<li><a @click="pesCon" href="disease-list.html">虫害防治</a></li>
							<li><a @click="dis" href="disease-list.html">病害科普</a></li>
							<li><a @click="disCon" href="disease-list.html">病害防治</a></li>
						</ul></li>
					<li><a href="exchange-list.html">讨论模块</a></li>
					<li><a href="forecast.html">数据预测</a></li>
					<li><a href="#">用户信息</a>
						<ul class="sub-menu">
							<li><a href="selectUser.html">查看用户信息</a></li>
							<li><a href="updateUser.html">修改用户信息</a></li>
							<li><a href="updateUserPassword.html">修改用户密码</a></li>
						</ul>
					</li>
					
				</ul>
			</div>
		</nav>
		<!-- End of Main Navigation -->

	</div>

</div>

                <div style="margin:0px auto;" class="keleyitable"><h2>我有话说</h2>
                <div id="app" style="margin:0 auto; width:600px;  ">
                <table style="  width: 600px;margin-top:50px;">
                	<tr>
                		<td style="  width: 100px; height: 50px;">声明：</td>
                		<td style="  width: 500px;">
						<span>1：不得发表违反国家法律、危害国家安全、泄漏国家机密、破坏民族统一的言论</span>
						<br />
                		<span>2：不得发表淫秽、色情、读博、暴力、恐怖或者教唆犯罪的言论</span>
                		<br />
                		<span>3：不得发表损害国家利益、破坏国际政策、宣扬邪教和封建迷信的言论</span>
                		</td>
                	</tr>
                	<tr>
                		<td style="  width: 100px; height: 50px;">标题：</td>
                		<td style="  width: 500px;">
                			<input v-model="Title" placeholder="请输入标题"  style="width: 500px; margin-top:8px;" type="text" name="phon" id="phon" class="required input-xlarge" value="" >
                		</td>
                	</tr>
                	<tr>
                		<td style="  width: 100px; height: 50px;">类型：</td>
                		<td style="  width: 500px;">
                			<select v-model="Sort" name="que1" id="que1" style="width: 515px; height: 40px; margin-top:8px;"	>
							<!--
                            	1是虫害
                            	2是虫害防治
                            	3是病害
                            	4是病害防治
                            -->
							<option value="1">虫害科普</option>
							<option value="2">虫害防治</option>
							<option value="3">病害科普</option>
							<option value="4">病害防治</option>
							<option value="5">讨论帖</option>
							</select>
                		</td>
                	</tr>
					<tr>
						<td style="  width: 100px; height: 50px;">选择图片； </td>

						<td style="  width: 400px;">
							<input id="img" style="width: 400px; margin-top:8px;" type="file" name="phon"  class="required input-xlarge" value="" >
						</td>
						<td></td>
					</tr>
                	<tr>
                		<td style="  width: 100px; height: 50px;">内容：</td>
                		<td style="  width: 500px;">
                			<textarea v-model="detailes" placeholder="请输入内容"  style="width: 500px; height: 300px; margin-top:8px;"	>

                			</textarea>
                			</td>
                	</tr>
                	<tr>

                		<td >
                			<input @click="sub" class="btn"  type="sunmit" style="width: 150px; height: 50px;"  value="提交" style=" height: 50px;">
                		</td>

                	</tr>

                </table>




				 </div>


				</div>
 				<script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
                <script type='text/javascript' src='js/jquery.easing.1.34e44.js?ver=1.3'></script>
                <script type='text/javascript' src='js/prettyphoto/jquery.prettyPhotoaeb9.js?ver=3.1.4'></script>
                <script type='text/javascript' src='js/jquery.liveSearchd5f7.js?ver=2.0'></script>
				<script type='text/javascript' src='js/jflickrfeed.js'></script>
                <script type='text/javascript' src='js/jquery.formd471.js?ver=3.18'></script>
                <script type='text/javascript' src='js/jquery.validate.minfc6b.js?ver=1.10.0'></script>
                <script type='text/javascript' src='js/custom5152.js?ver=1.0'></script>
                  <script type="text/javascript" src="js/url.js"></script>
				<script type="text/javascript" src="js/vue(1).js"></script>
				<script type="text/javascript" src="js/axios.min.js"></script>
				<script>
					var vue = new Vue({
						el: '#app', //挂载点
						data: {
						    id:'',
							Title:'',
							Sort:'',
							detailes:'',
							 //flag:false,
							name:''


						},
						   dataType:'JSONP',  // 处理Ajax跨域问题
						created: function() {
                            this.userOrAdmin();
						},

						methods: {
							//提交
                            userOrAdmin: function(){
                                var self = this;
                                var userSort = window.sessionStorage.getItem("userSort");
                                console.log(userSort)
                                
                                if(userSort === 2 ){
                                	
                                    //self.flag = true;
                                }
                            },
                            serch:function(){
                            	var self = this;
                                self.id = Math.random().toString();
                            	if( self.Sort == 1 || self.Sort == 2 || self.Sort == 3 || self.Sort == 4 ){
									self.diss();
								}else if(self.Sort == 5){
									self.exc();
								}
                            },
							sub: function() {
								var self = this;
                                var params=new FormData();
                                params.append('file',document.getElementById("img").files[0]);
                                axios.defaults.withCredentials=true;
                                axios.post(web_server+"word/uploadVoice",params)
                                    .then(function(response){
                                        if(response.status==200){
                                        	self.name = response.data.data;
                                            self.serch();
                                        }else{
                                        }
                                    })
							},
                    	diss: function(){
								var self = this;
								self.userId = window.sessionStorage.getItem("userId");
									var param=new URLSearchParams();
                            		param.append('diseaseId',self.id );
									param.append('diseaseTitle',self.Title);
									param.append('diseaseSort',self.Sort);
									param.append('diseaseDetailes',self.detailes);
									param.append('userId',self.userId);
										param.append('name',self.name);
									axios
									.post(web_server+"insert/disease",param)
										.then(function(response) {
											var objects= response.data;
											if(objects.status == 200) {
											    self.inpho();
											}else if(objects.status == 500){
												alert("发帖成功")
											}
										})
									.catch(function(error) {
										alert("发帖成功")

									});
							},
							exc: function(){
								var self = this;
								self.userId = window.sessionStorage.getItem("userId");
									var param=new URLSearchParams();
                               		param.append('exchangeId',self.id );
									param.append('exchangeTitle',self.Title);
									param.append('exchangeDetailes',self.detailes);
									param.append('userId',self.userId);
										param.append('name',self.name);
									axios
									.post(web_server+"insert/exchange",param)
										.then(function(response) {
											var objects= response.data;
											if(objects.status == 200) {
											    self.inpho();
											}else if(objects.status == 500){
												alert(objects.message)
											}
										})
									.catch(function(error) {
										alert(error)

									});
							},
                            inpho: function(){
                                var self = this;
                                self.userId = window.sessionStorage.getItem("userId");
                                var param=new URLSearchParams();
                                param.append('articleId',self.id );
                                param.append('photoOne',self.name);
                                axios
                                    .post(web_server+"insert/photo",param)
                                    .then(function(response) {
                                        var objects= response.data;
                                        if(objects.status == 200) {
                                            alert("发帖成功")
                                            window.location.href = "exchange-list.html";
                                        }else if(objects.status == 500){
                                            alert(objects.message)
                                        }
                                    })
                                    .catch(function(error) {
                                        alert(error)

                                    });
                            },
                            insert: function(){
                                window.location.href = "red-skin.html";
                            },
                            pes:function(){
                                window.sessionStorage.setItem("sort", "1");
                            },
                            pesCon:function(){
                                window.sessionStorage.setItem("sort", "2");
                            },
                            dis:function(){
                                window.sessionStorage.setItem("sort", "3");
                            },
                            disCon:function(){
                                window.sessionStorage.setItem("sort", "4");
                            }

						}
					})
				</script>
</body>
</html>